#include<graphics.h>
#include<conio.h>
#include<stdio.h>
#define TLC 40
#define BRC 440
#define WALL_LEN (BRC-TLC)/16
struct mouse_info	{
	unsigned int x;
	unsigned int y;
	unsigned int button;
};

void reset_mouse()
{
	asm mov ax,0;
	asm int 0x33;
}

void init_mouse()
{
	reset_mouse();
	asm mov ax,1;
	asm int 0x33;
}

void hide_mouse()
{
	asm mov ax,2;
	asm int 0x33;
}

void get_mouse_info(struct mouse_info *info)
{
	unsigned int x,y,b;
	asm mov ax,3;
	asm int 0x33;
	asm mov x,cx;
	asm mov y,dx;
	asm mov b,bx;
	info->x=x;
	info->y=y;
	info->button=b;
}

//void create_wall(unsigned int x,unsigned int y)
//{

#include <dos.h>
#include <process.h>

void main()
{
	struct mouse_info info;
	int gdriver=DETECT,gmode;
	printf("\n%x",MK_FP(0x100,0x100));
	getch();
	exit(0);
	initgraph(&gdriver,&gmode,"");
	setbkcolor(1);
	rectangle(TLC,TLC,BRC,BRC);
	for(int col=TLC;col<=BRC;col=col+WALL_LEN)	{
		line(col,TLC,col,BRC);
	}
	for(int row=TLC;row<=BRC;row=row+WALL_LEN)	{
		line(TLC,row,BRC,row);
	}
	outtextxy(0,0,"MM simulator");
	outtextxy(0,10,"Click on walls to draw walls");
	init_mouse();
	while(1)	{
		get_mouse_info(&info);
		if(info.button==1)	{
			putpixel(info.x,info.y,15);
		}
		else	{
			break;
		}
	}
}